<?php
/**
 * Prado Portal.
 *
 * @author Steen Rabol <steen.rabol@gmail.com>
 * @link http://www.pradoportal.dk/
 * @copyright Copyright &copy; 2006,2007,2008 Steen Rabol
 * @license http://www.pradoportal.dk
 * @version $Id: PortalDbCache.php 289 2008-11-14 05:34:40Z steen.rabol@gmail.com $
 * @package Pradoportal.Common.PortalDbCache
 */

Prado::using('System.Data.TDbConnection');
Prado::using('System.Caching.TDbCache');
Prado::using('Application.Common.PortalUtil');

class PortalDbCache extends TDbCache
{
	public function init($config)
	{
		if($this->Application->Parameters['RunMode'] != 'Install')
		{
			$parameters				= $this->Application->Parameters;
			$this->ConnectionString	= strtolower($parameters['DbType']) . ":host=" . $parameters['DbHost'] . ";dbname=" . $parameters['DbDatabase'];
			$this->Username			= $parameters['DbUser'];
			$this->Password			= $parameters['DbPassword'];
			parent::init($config);
		}
	}
}
?>